package com.datoucai.common;

import com.alibaba.csp.sentinel.adapter.servlet.callback.WebCallbackManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
@Slf4j
public class SentinelConfig {


    @PostConstruct
    public void init() {
        //设置url清洗
//        WebCallbackManager.setUrlCleaner(new SentinelWebUrlCleaner());
        WebCallbackManager.setUrlBlockHandler(new WebUrlBlockHandler());
//        WebCallbackManager.setRequestOriginParser(new SentinelRequestOriginParser());
    }
}